<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding: 0;box-sizing: border-box;}
        .red{color: red;}.green{color: green;}.yellow{color: yellow;}.blue{color: blue;}.black{color: black;}
        .blod400{font-weight: 400;}.blod700{font-weight: 700;}.italic{font-style: italic;}
        .fontsize18{font-size: 12px;}.fontsize18{font-size: 18px;}.fontsize24{font-size: 24px;}.fontsize32{font-size: 32px;}
        .underline{text-decoration: underline;}.linethrough{text-decoration: line-through;}.linedouble{border-bottom: 6px double black;}
        .center{text-align: center;}.left{text-align: left;}.right{text-align: right;}
        .borderbottom{border-bottom: 2px black solid;padding-bottom: 12px;margin-bottom: 12px;}.borderall{border: 2px black solid;padding-bottom: 12px;}
        main{padding: 12px 24px;margin: 6px;}
        p,div.common{padding: 6px; margin: 6px;}
        div.info{padding: 6px; margin: 6px;border: 5px solid green;}
        div.error{padding: 6px; margin: 6px;border: 5px solid red;}
        ol,ul{list-style: inside;padding: 2px 24px;}
        ol{list-style-type: decimal;}ol>li{margin: 9px 2em;}
        p.question{color: blue;font-size: 18px;font-weight: 700;}
        p.answer{text-indent: 2em;margin: 1px;padding: 1px;}
        table{border-collapse: collapse; width: 100%;}
        table th{border: 1px solid white;background-color: blue;color: white;}
        table td{border-right: 1px solid black;border-bottom: 1px solid black;}
        table tr:hover{background: yellowgreen;cursor: pointer;}
        table td:last-of-type{border-right: none;}
        table th, table td{padding: 6px 8px;}
    </style>
</head>
<body>
    <p class="center blod700 fontsize32">Django布尔型字段</p>

    <div class="common">
        <table>
            <thead>
                <tr>
                    <th>字段类型</th>
                    <th>字段说明</th>
                    <th>值范围</th>
                    <th>对应表单组件</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>BooleanField</td>
                    <td>布尔类型字段</td>
                    <td>true/false</td>
                    <td>CheckboxInput</td>
                </tr>
                <tr>
                    <td>NullBooleanField</td>
                    <td>布尔类型字段</td>
                    <td>true/false</td>
                    <td>NullBooleanSelect</td>
                </tr>
            </tbody>
        </table>
    </div>

    <p class="question">注意点：</p>
    <ol>
        <li>BooleanField设置参数null=True时，对应表单控件NullBooleanSelect。</li>
        <li>BooleanField未设置默认参数default时，默认值为None。</li>
        <li>NullBooleanField即将被弃用。</li>
    </ol>

</body>
</html>
